﻿using System;
using Super_Management_Mayhem.Screens.Playing.GameMode;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Content.Spritesheet
{
    public class MenuSheet : SpriteSheetInstance
    {
        private static SpriteSheetInstance _instance;
        public static void LoadContent()
        {
            _instance = new MenuSheet();
        }
        public new static Sprite GetSprite(Enum textureName)
        {
            return _instance.GetSprite(textureName);
        }
        public static SpriteSheetInstance GetInstance()
        {
            return _instance;
        }

        public enum WaitingMenu
        {
            Panel,
            Chain,
            FaceLeft,
            FaceRight,
            LockLeft,
            LockCenter,
            LockRight,
        }

        public enum Menu
        {
            LetterSelected,
            Enter,
            ColorSquare,
            SpotLight,
            ProfileCard,
            Arrow,
        }

        public enum KeyboardOutline
        {
            TopLeftCorner,
            Top,
            TopRightCorner,
            Left,
            Center,
            Right,
            BottomLeftCorner,
            Bottom,
            BottomRightCorner,
        }

        public enum Button
        {
            Background,
            Hover,
            Foreground,
            Selected0,
            Selected1,
            Selected2,
            Selected3,
            Selected4,
            Selected5,
            Selected6,
            Selected7,
            Selected8,
            Selected9,
            NotSelected
        }

        public enum PlayerIcon
        {
            Background,
            ColorSelector,
        }

        public enum LetterAlphabet
        {
            A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
            a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z,
            Unknown, Underscore, LesserThan, Period, InterrogationPoint,
            Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9
        }

        public enum NewIcon
        {
            Icon,
            Star0,
            Star1,
            Star2,
            Star3,
            Star4
        }


        public override string SpriteSheetPath
        {
            get
            {
                return "Content/Images/Menu.png";
            }
        }

        protected override void LoadSprites()
        {
            AddEnumList<LetterAlphabet>(LetterAlphabet.A, LetterAlphabet.Num9, new TE_Rectangle(0, 2, 0.5f, 1), 26);

            AddSprite(Button.Hover, new TE_Rectangle(0, 0, 8, 2));
            AddSprite(Button.Background, new TE_Rectangle(8, 0, 8, 2));
            AddSprite(Button.Foreground, new TE_Rectangle(16, 0, 8, 2));
            AddSprite(Button.NotSelected, new TE_Rectangle(0, 0, 0, 0));
            AddEnumList<Button>(Button.Selected0, Button.Selected9, new TE_Rectangle(0, 5, 8, 2), SpriteSheet.AddEnumOrientation.Vertical);

            AddEnumList<KeyboardOutline>(KeyboardOutline.TopLeftCorner, KeyboardOutline.BottomRightCorner, new TE_Rectangle(8, 13, 1, 1), 3);
            AddSprite(Menu.LetterSelected, new TE_Rectangle(11, 13, 2, 2));
            AddSprite(Menu.Enter, new TE_Rectangle(11, 15, 2, 2));
            AddSprite(Menu.ColorSquare, new TE_Rectangle(8, 16, 1, 1));
            AddSprite(Menu.SpotLight, new TE_Rectangle(13, 11, 5, 8));
            AddSprite(Menu.ProfileCard, new TE_Rectangle(18, 9, 8, 10));
            AddSprite(Menu.Arrow, new TE_Rectangle(13, 3, 2, 2));

            AddSprite(WaitingMenu.Panel, new TE_Rectangle(16, 0, 8, 2));
            AddSprite(WaitingMenu.Chain, new TE_Rectangle(13, 2, 0.5f, 1));
            AddEnumList<WaitingMenu>(WaitingMenu.LockLeft, WaitingMenu.LockRight, new TE_Rectangle(14, 2, 1, 1));
            AddEnumList<WaitingMenu>(WaitingMenu.FaceLeft, WaitingMenu.FaceRight, new TE_Rectangle(8, 17, 2.5f, 5));

            AddEnumList<GameMode.GameModes>(GameMode.GameModes.CaptureTheFlag, GameMode.GameModes.TeamMoneyMayhem, new TE_Rectangle(14, 5, 4, 4));

            AddSprite(NewIcon.Icon, new TE_Rectangle(17, 2, 2.5f, 1));
            AddEnumList<NewIcon>(NewIcon.Star0, NewIcon.Star4, new TE_Rectangle(17, 3, 0.5f, 0.5f));

            AddEnumList<PlayerIcon>(PlayerIcon.Background, PlayerIcon.ColorSelector, new TE_Rectangle(8, 5, 2.5f, 3));
        }
    }
}